async function errorCaptured(fn) {
  try {
    const res = await fn()
    return [null, res];
  } catch(e) {
    return [e, null]
  }
}

// 使用
const [err, res] = await errorCaptured(asyncFn);